<%@ page language="java" pageEncoding="UTF-8"%>
<!DOCTYPE HTML>
<html>
<title>积分明细</title>
<%@include file="/common/wxCommon.jspf"%>
<style>
.weui_cell:before {
	left: 0px;
}
</style>
<body ontouchstart>
	<c:if test="${orgInfo.integral eq 0 }">
		<div class="weui_msg">
			<div class="weui_icon_area">
				<i class="weui_icon_info weui_icon_msg"></i>
			</div>
			<div class="weui_text_area">
				<p class="weui_msg_desc">无记录</p>
			</div>
		</div>
	</c:if>
	<div class="bd">
	</div>
	<script type="text/javascript">
		var pageNow = 1;
		var loading = false;
		$(document.body).infinite().on("infinite", function() {
		    loadData();
		});
		
		function loadData() {
			if (loading) return;
		    loading = true;
			$.getJSON(rootPath + '/weixin/org/integral/findByPage.shtml', {'pageNow' : pageNow, 'pageSize' : 10}, function(result){
	    		$.each(result.records, function(i, e){
	    			$(".bd").append("<div class='weui_cell'><div class='weui_cell_bd weui_cell_primary'><p class='ellipsis'>" + e.description +
		        			 "</p><label class='cell-tips'>" + (new Date(e.createTime).format("yyyy-MM-dd hh:mm")) + "</label></div>" + 
		        			 "<div class='weui_cell_ft " + (e.integral > 0 ? 'plus' : 'minus') + "'>" +
		        			  (e.integral > 0 ? "+" : "-") + "&nbsp;&nbsp;" + Math.abs(e.integral) + "</div></div>");
		        });
		    	pageNow += 1;
		    	loading = false;
		    	if (pageNow > result.pageCount) {
					$(document.body).destroyInfinite();
				}
		    });
		}
		$(function(){
			loadData();
		});
	</script>
</body>
</html>